export default {
	data() {
		return {
			orderList: []
		}
	},
	async onLoad(options) {
		console.log("shipping index onLoad: ", options);
		await this.getShippingList();
	},
	async onShow() {},
	methods: {
		async getShippingList() {
			const listRes = await this.$uniCloudCallFunction({
				name: 'xxf-manager',
				action: 'getShippingList',
				data: {
					uid: this.$store.state.login.uid,
				}
			});
			console.log("listRes: ", listRes);
			if (listRes) {
				this.orderList = listRes || [];
			} else {
				this.orderList = [];
			}
		},
		onShipping(e) {
			console.log("onShipping: ", e);
			this.$refs.shippingRef.popupOpen({
				orderInfo: e,
				type: "shipping"
			});
		},
		popupChange(e) {
			this.popupShow = e.show;
		},
		async shippingSuccess(e) {
			console.log("shippingSuccess: ", e);
			this.$utils.showToast(this, {
				message: '发货成功！',
				mode: 1
			});
			await this.getShippingList();
		}
	},
}